package servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/UserLoginServlet")
public class UserLoginServlet extends HttpServlet {//把UserLoginServlet改为自己名字加Servlet
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        request.setCharacterEncoding("UTF-8");

        String strAdminName = request.getParameter("adminName");

        String strAdminPsw = request.getParameter("adminPsw");

        System.out.println("登录用户名：" + strAdminName + ";密码：" + strAdminPsw);

        request.getSession().setAttribute("loginedName", strAdminName);

        request.getRequestDispatcher("logined.jsp").forward(request, response);

    }
}